import {WeaAlertPage} from 'ecCom';
import {Table} from 'antd';
import Util from '../../../../util/util';
import {WeaLocaleProvider} from 'ecCom';
import {inject} from 'mobx-react';
const getLabel = WeaLocaleProvider.getLabel;

@inject('meetingDialog')
class MeetService extends React.Component {
	constructor(props) {
		super(props);
	}
	render() {
        let {columns = [], datas} = this.props.data || {};
        columns.forEach((col) => {
            col.render = Util.tableCol.render(col);
        });
        const { setEditTableCloumnCount } = this.props.meetingDialog;
		return (
			<div className="wea-meeting-service-view">
                <div className="panel-title">{getLabel(383557,"服务列表")}</div>
                {columns.length == 0 || datas.length == 0 ?
                    <WeaAlertPage ecId={`${this && this.props && this.props.ecId || ''}_WeaAlertPage@kv51zc`} icon="icon-blog-blank">
                        <div style = {{color : '#ccc'}}>
                            {getLabel(83553,'暂无数据')}
                        </div>
                    </WeaAlertPage>:
                    <div className="wea-new-table">
                        <Table ecId={`${this && this.props && this.props.ecId || ''}_Table@qtpwe6`} 
                            columns={columns} 
                            dataSource={datas} 
                            pagination={false}
                            scroll={{ x: columns.length > setEditTableCloumnCount ? 100*columns.length : '', y: this.props.height-90 }}
                        />
                    </div>
                }
            </div>
		);
	}
}

export default MeetService;